home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / New System Software Extensions / QuickDraw™ GX v1.0ß2 / Interfaces & Libraries / interfaces / graphics errors.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-29  |  16.8 KB  |  519 lines  |  [TEXT/MPS ]

  1. /* graphics:
  2.     public error equates
  3.     by Cary Clark, Georgiann Delaney, Michael Fairman, Dave Good, Robert Johnson, Keith McGreggor, Oliver Steele, David Van Brink, Chris Yerga
  4.     Copyright 1987 - 1991 Apple Computer, Inc.  All rights reserved.    */
  5.  
  6.  
  7. #ifndef graphicsErrorsIncludes
  8.     #define graphicsErrorsIncludes
  9.  
  10.     #define gxFirstErrorNumber                -27999
  11.     #define gxFirstFatalError             -27900
  12.     #define gxLastFatalError          (gxFirstNonfatalError - 1)
  13.     #define gxFirstNonfatalError          -27800
  14.     #define gxFirstParameterError         -27700
  15.     #define gxFirstImplementationLimitError   -27400
  16.     #define gxFirstLibraryError               -27300
  17.     #define gxFirstAppError               -27200
  18.     #define gxLastErrorNumber             -27000
  19.  
  20.     #define gxFirstWarningNumber          -26999
  21.     #define gxFirstWrongTypeWarning       -26900
  22.     #define gxFirstResultOutOfRangeWarning    -26800
  23.     #define gxFirstParameterOutOfRangeWarning -26700
  24.     #define gxFirstLibraryWarning         -26600
  25.     #define gxFirstAppWarning             -26500
  26.     #define gxLastWarningNumber           -26000
  27.  
  28.     #define gxFirstNoticeNumber           -25999
  29.     #define gxFirstLibraryNotice          -25900
  30.     #define gxFirstAppNotice              -25800
  31.     #define gxLastNoticeNumber                -25500
  32.  
  33.     typedef enum {
  34.         /* truly fatal errors */
  35.         out_of_memory = gxFirstErrorNumber,
  36.         internal_fatal_error,
  37.         no_outline_font_found,
  38.         not_enough_memory_for_graphics_client_heap,
  39.         could_not_create_backing_store,
  40.  
  41.         /* internal errors */
  42.         internal_error = gxFirstNonfatalError,
  43.         internal_font_error,
  44.         internal_layout_error,
  45.         functionality_unimplemented,
  46.         clip_to_frame_shape_unimplemented,
  47.  
  48.         /* gxFont scaler errors */
  49.         gxFirstFontScalerError,
  50.         null_font_scaler_context = gxFirstFontScalerError,
  51.         null_font_scaler_input,
  52.         invalid_font_scaler_context,
  53.         invalid_font_scaler_input,
  54.         invalid_font_scaler_font_data,
  55.         font_scaler_newblock_failed,
  56.         font_scaler_bitmap_allocation_failed,
  57.         font_scaler_outline_allocation_failed,
  58.         required_font_scaler_table_missing,
  59.         unsupported_font_scaler_outline_format,
  60.         unsupported_font_scaler_stream_format,
  61.         unsupported_font_scaler_font_format,
  62.         font_scaler_hinting_error,
  63.         font_scaler_rasterizer_error,
  64.         font_scaler_internal_error,
  65.         font_scaler_invalid_matrix,
  66.         font_scaler_fixed_overflow,
  67.         font_scaler_api_version_mismatch,
  68.         gxLastFontScalerError = font_scaler_api_version_mismatch,
  69.         unknown_font_scaler_error,
  70.  
  71.         /* gxFont manager errors */
  72.         illegal_font_storage_type,
  73.         illegal_font_storage_reference,
  74.         illegal_font_attributes,
  75.         illegal_font_parameter,
  76.         font_cannot_be_changed,
  77.         
  78.         /* recoverable errors */
  79.         fragmented_memory,
  80.         could_not_dispose_backing_store,
  81.         unflattening_interrupted_by_client,
  82.  
  83.         /* bad parameters */
  84.         parameter_is_nil = gxFirstParameterError,
  85.         shape_is_nil,
  86.         style_is_nil,
  87.         transform_is_nil,
  88.         ink_is_nil,
  89.         transferMode_is_nil,
  90.         color_is_nil,
  91.         colorProfile_is_nil,
  92.         colorSet_is_nil,
  93.         spoolProcedure_is_nil,
  94.         tag_is_nil,
  95.         type_is_nil,
  96.         mapping_is_nil,
  97.         
  98.         parameter_out_of_range,
  99.         inconsistent_parameters,
  100.         index_is_less_than_zero,
  101.         index_is_less_than_one,
  102.         count_is_less_than_zero,
  103.         count_is_less_than_one,
  104.         contour_is_less_than_zero,
  105.         length_is_less_than_zero,
  106.         
  107.         invalid_client_reference,
  108.         invalid_graphics_heap_start_pointer,
  109.         invalid_nongraphic_globals_pointer,
  110.  
  111.         colorSpace_out_of_range,
  112.  
  113.         pattern_lattice_out_of_range,
  114.         frequency_parameter_out_of_range,
  115.         tinting_parameter_out_of_range,
  116.         method_parameter_out_of_range,
  117.         space_may_not_be_indexed,
  118.         
  119.         glyph_index_too_small,
  120.         no_glyphs_added_to_font,
  121.         glyph_not_added_to_font,
  122.         point_does_not_intersect_bitmap,
  123.  
  124.         required_font_table_not_present,
  125.         unknown_font_table_format,
  126.  
  127.         shapeFill_not_allowed,
  128.         inverseFill_face_must_set_clipLayer_flag,
  129.         invalid_transferMode_colorSpace,
  130.         colorProfile_must_be_nil,
  131.         bitmap_pixel_size_must_be_1,
  132.         empty_shape_not_allowed,
  133.         ignorePlatformShape_not_allowed,
  134.         nil_style_in_glyph_not_allowed,
  135.         complex_glyph_style_not_allowed,
  136.         
  137.         cannot_set_item_shapes_to_nil,
  138.         cannot_use_original_item_shapes_when_growing_picture,
  139.         cannot_add_unspecified_new_glyphs,
  140.         cannot_dispose_locked_tag,
  141.         cannot_dispose_locked_shape,
  142.     
  143.         graphic_type_does_not_have_a_structure,
  144.         style_run_array_does_not_match_number_of_characters,
  145.         rectangles_cannot_be_inserted_into,
  146.         
  147.         unknown_graphics_heap,
  148.         graphics_routine_selector_is_obsolete,
  149.         cannot_set_graphics_client_memory_without_setting_size,
  150.         graphics_client_memory_too_small,
  151.         graphics_client_memory_is_already_allocated,
  152.         
  153.         viewPort_is_a_window,
  154.  
  155.         /* wrong type/bad reference */
  156.         illegal_type_for_shape,
  157.         invalid_viewDevice_reference,
  158.         invalid_viewGroup_reference,
  159.         invalid_viewPort_reference,
  160.  
  161.         /* validation errors */
  162.         no_owners,
  163.         bad_address,
  164.         object_wrong_type,
  165.         shape_wrong_type,
  166.         style_wrong_type,
  167.         ink_wrong_type,
  168.         transform_wrong_type,
  169.         device_wrong_type,
  170.         port_wrong_type,
  171.         
  172.             /* cache errors */
  173.         shape_cache_wrong_type,
  174.         style_cache_wrong_type,
  175.         ink_cache_wrong_type,
  176.         transform_cache_wrong_type,
  177.         port_cache_wrong_type,
  178.         shape_cache_parent_mismatch,
  179.         style_cache_parent_mismatch,
  180.         ink_cache_parent_mismatch,
  181.         transform_cache_parent_mismatch,
  182.         port_cache_parent_mismatch,
  183.         invalid_shape_cache_port,
  184.         invalid_shape_cache_device,
  185.         invalid_ink_cache_port,
  186.         invalid_ink_cache_device,
  187.         invalid_style_cache_port,
  188.         invalid_style_cache_device,
  189.         invalid_transform_cache_port,
  190.         invalid_transform_cache_device,
  191.         
  192.         indirect_memory_block_too_small,
  193.         indirect_memory_block_too_large,
  194.         unexpected_nil_pointer,
  195.         invalid_pointer,
  196.         invalid_seed,
  197.         invalid_frame_seed,
  198.         invalid_text_seed,
  199.         invalid_draw_seed,
  200.         bad_private_flags,
  201.         text_bounds_cache_wrong_size,
  202.         text_metrics_cache_wrong_size,
  203.         text_index_cache_wrong_size,
  204.         bitmap_ptr_too_small,
  205.         bitmap_ptr_not_aligned,
  206.         bitmap_rowBytes_negative,
  207.         bitmap_width_negative,
  208.         bitmap_height_negative,
  209.         invalid_pixelSize,
  210.         bitmap_rowBytes_too_small,
  211.         bitmap_rowBytes_not_aligned,
  212.         bitmap_rowBytes_must_be_specified_for_user_image_buffer,
  213.         invalid_matrix_flag,
  214.         invalid_vector_count,
  215.         invalid_contour_count,
  216.         recursive_caches,
  217.         glyph_run_count_negative,
  218.         glyph_run_count_zero,
  219.         glyph_run_counts_do_not_sum_to_character_count,
  220.         glyph_first_advance_bit_set_not_allowed,
  221.         glyph_tangent_vectors_both_zero,
  222.         layout_run_length_negative,
  223.         layout_run_length_zero,
  224.         layout_run_level_negative,
  225.         layout_run_lengths_do_not_sum_to_text_length,
  226.         invalid_fillShape_ownerCount,
  227.         recursive_fillShapes,
  228.         bad_shape_in_picture,
  229.         bad_style_in_picture,
  230.         bad_ink_in_picture,
  231.         bad_transform_in_picture,
  232.         bad_shape_cache_in_picture,
  233.         bad_seed_in_picture,
  234.         invalid_picture_count,
  235.         bad_textLayer_count,
  236.         bad_fillType_in_textFace,
  237.         bad_style_in_textFace,
  238.         bad_transform_in_textFace,
  239.         transform_clip_missing,
  240.         metrics_wrong_type,
  241.         metrics_point_size_probably_bad,
  242.         scalar_block_wrong_type,
  243.         scalar_block_parent_mismatch,
  244.         scalar_block_too_small,
  245.         scalar_block_too_large,
  246.         invalid_metrics_range,
  247.         invalid_metrics_flags,
  248.         metrics_maxWidth_probably_bad,
  249.         font_wrong_type,
  250.         font_wrong_size,
  251.         invalid_font_platform,
  252.         invalid_lookup_range,
  253.         invalid_lookup_platform,
  254.         font_not_in_font_list,
  255.         metrics_not_in_metrics_list,
  256.         bad_device_private_flags,
  257.         bad_device_attributes,
  258.         invalid_device_number,
  259.         invalid_device_viewGroup,
  260.         invalid_device_bounds,
  261.         invalid_bitmap_in_device,
  262.         colorSet_wrong_type,
  263.         invalid_colorSet_viewDevice_owners,
  264.         invalid_colorSet_colorSpace,
  265.         invalid_colorSet_count,
  266.         colorProfile_wrong_type,
  267.         invalid_colorProfile_flags,
  268.         invalid_colorProfile_response_count,
  269.         backing_free_parent_mismatch,
  270.         backing_store_parent_mismatch,
  271.     
  272.     /* implementation limits */
  273.         number_of_contours_exceeds_implementation_limit = gxFirstImplementationLimitError,
  274.         number_of_points_exceeds_implementation_limit,
  275.         size_of_polygon_exceeds_implementation_limit,
  276.         size_of_path_exceeds_implementation_limit,
  277.         size_of_text_exceeds_implementation_limit,
  278.         size_of_bitmap_exceeds_implementation_limit,
  279.         number_of_colors_exceeds_implementation_limit
  280.  
  281.  
  282.     #ifndef privateGraphicTypesIncludes
  283.         ,
  284.         /* library errors */
  285.         common_colors_not_initialized = gxFirstLibraryError,
  286.         no_open_picture,
  287.         picture_already_open,
  288.         no_open_poly,
  289.         poly_already_open,
  290.         no_open_region,
  291.         region_already_open,
  292.         no_active_picture
  293.     #endif
  294.     } gxGraphicErrors;
  295.  
  296.  
  297.     typedef enum {
  298.         /* warnings about warnings */
  299.         warning_stack_underflow = gxFirstWarningNumber,
  300.         warning_stack_overflow,
  301.         notice_stack_underflow,
  302.         notice_stack_overflow,
  303.  
  304.         /* can't do this to that */
  305.         shape_does_not_contain_text = gxFirstWrongTypeWarning,
  306.         shape_does_not_contain_a_bitmap,
  307.         picture_expected,
  308.         bitmap_is_not_resizable,
  309.         shape_operator_may_not_be_a_bitmap,
  310.         shape_operator_may_not_be_a_picture,
  311.         graphic_type_does_not_contain_points,
  312.         graphic_type_does_not_have_multiple_contours,
  313.         graphic_type_cannot_be_mapped,
  314.         graphic_type_cannot_be_moved,
  315.         graphic_type_cannot_be_scaled,
  316.         graphic_type_cannot_be_rotated,
  317.         graphic_type_cannot_be_skewed,
  318.         graphic_type_cannot_be_reset,
  319.         graphic_type_cannot_be_dashed,
  320.         graphic_type_cannot_be_reduced,
  321.         graphic_type_cannot_be_inset,
  322.         shape_cannot_be_inverted,
  323.  
  324.         /* result went out of range */
  325.         map_shape_out_of_range = gxFirstResultOutOfRangeWarning,
  326.         move_shape_out_of_range,
  327.         scale_shape_out_of_range,
  328.         rotate_shape_out_of_range,
  329.         skew_shape_out_of_range,
  330.         map_transform_out_of_range,
  331.         move_transform_out_of_range,
  332.         scale_transform_out_of_range,
  333.         rotate_transform_out_of_range,
  334.         skew_transform_out_of_range,
  335.  
  336.         /* gave a parameter out of range */
  337.         contour_out_of_range = gxFirstParameterOutOfRangeWarning,
  338.         index_out_of_range_in_contour,
  339.         picture_index_out_of_range,
  340.         color_index_requested_not_found,
  341.         colorSet_index_out_of_range,
  342.         index_out_of_range,
  343.         count_out_of_range,
  344.         length_out_of_range,
  345.         font_table_index_out_of_range,
  346.         font_glyph_index_out_of_range,
  347.         font_table_not_found,
  348.         font_name_not_found,
  349.         
  350.  
  351.         /* restricted access */
  352.         shape_access_not_allowed,
  353.         colorSet_access_restricted,
  354.         colorProfile_access_restricted,
  355.         tag_access_restricted,
  356.         viewDevice_access_restricted,
  357.         
  358.         /* nonsense data */
  359.         new_shape_contains_invalid_data,
  360.         new_tag_contains_invalid_data,
  361.         extra_data_passed_was_ignored,
  362.  
  363.         /* doesn't make sense to do */
  364.         unable_to_traverse_open_contour_that_starts_or_ends_off_the_curve,
  365.         unable_to_draw_open_contour_that_starts_or_ends_off_the_curve,
  366.         picture_cannot_contain_itself,
  367.         viewPort_cannot_contain_itself,
  368.         cannot_dispose_default_shape,
  369.         cannot_dispose_default_style,
  370.         cannot_dispose_default_ink,
  371.         cannot_dispose_default_transform,
  372.         cannot_dispose_default_colorProfile,
  373.         cannot_dispose_default_colorSet,
  374.         cannot_set_unique_items_attribute_for_a_picture_that_already_contains_items,
  375.         shape_not_locked,
  376.         tag_not_locked,
  377.         shape_direct_attribute_not_set,
  378.         first_glyph_advance_must_be_absolute,
  379.  
  380.         /* couldn't find what you were looking for */
  381.         shape_does_not_have_area,
  382.         shape_does_not_have_length,
  383.         point_does_not_intersect_port,
  384.         cannot_dispose_non_font,
  385.  
  386.         /* might not be what you expected */
  387.         character_substitution_took_place,
  388.         font_substitution_took_place,
  389.         union_of_area_and_length_returns_area_only,
  390.         insufficient_coordinate_space_for_new_device,
  391.  
  392.         /*storage */
  393.         unrecognized_stream_version,
  394.         bad_data_in_stream,
  395.  
  396.         /* gxFont scaler warnings */
  397.         gxFirstFontScalerWarning,
  398.         font_scaler_no_output = gxFirstFontScalerWarning,
  399.         font_scaler_fake_metrics,
  400.         font_scaler_fake_linespacing,
  401.         font_scaler_glyph_substitution,
  402.         gxLastFontScalerWarning = font_scaler_glyph_substitution,
  403.         
  404.         /* other */
  405.         shape_passed_has_no_bounds,
  406.         layer_style_cannot_contain_a_face,
  407.         layer_glyph_shape_cannot_contain_nil_styles,
  408.         face_override_style_font_must_match_style,
  409.         tags_of_type_flst_removed,
  410.         translator_already_installed_on_this_grafport,
  411.         translator_not_installed_on_this_grafport
  412.     #ifndef privateGraphicTypesIncludes
  413.         ,
  414.         /* library */
  415.         no_picture_drawn = gxFirstLibraryWarning,
  416.         polygons_have_different_size_contours,
  417.         graphic_type_cannot_be_specifed_by_four_values,
  418.         graphic_type_cannot_be_specifed_by_six_values,
  419.         point_expected,
  420.         line_or_rectangle_expected,
  421.         curve_expected,
  422.         graphic_type_does_not_contain_control_bits,
  423.         request_exceeds_available_data,
  424.         extra_data_unread,
  425.         no_variable_length_user_data_saved
  426.     #endif
  427.     } gxGraphicWarnings;
  428.  
  429.  
  430. #ifdef debugging
  431.     typedef enum {
  432.         parameters_have_no_effect = gxFirstNoticeNumber,
  433.         attributes_already_set,
  434.         caps_already_set,
  435.         clip_already_set,
  436.         color_already_set,
  437.         curve_error_already_set,
  438.         dash_already_set,
  439.         default_colorProfile_already_set,
  440.         default_ink_already_set,
  441.         default_transform_already_set,
  442.         default_shape_already_set,
  443.         default_style_already_set,
  444.         dither_already_set,
  445.         encoding_already_set,
  446.         face_already_set,
  447.         fill_already_set,
  448.         font_already_set,
  449.         font_variations_already_set,
  450.         glyph_positions_are_already_set,
  451.         glyph_tangents_are_already_set,
  452.         halftone_already_set,
  453.         hit_test_already_set,
  454.         ink_already_set,
  455.         join_already_set,
  456.         justification_already_set,
  457.         mapping_already_set,
  458.         pattern_already_set,
  459.         pen_already_set,
  460.         style_already_set,
  461.         tag_already_set,
  462.         text_attributes_already_set,
  463.         text_size_already_set,
  464.         transfer_already_set,
  465.         transform_already_set,
  466.         type_already_set,
  467.         viewPorts_already_set,
  468.         viewPort_already_in_viewGroup,
  469.         viewDevice_already_in_viewGroup,
  470.         
  471.         geometry_unaffected,
  472.         mapping_unaffected,
  473.         tags_in_shape_ignored,
  474.  
  475.         shape_already_in_primitive_form,
  476.         shape_already_in_simple_form,
  477.         shape_already_broken,
  478.         shape_already_joined,
  479.         cache_already_cleared,
  480.  
  481.         shape_not_disposed,
  482.         style_not_disposed,
  483.         ink_not_disposed,
  484.         transform_not_disposed,
  485.         colorSet_not_disposed,
  486.         colorProfile_not_disposed,
  487.         font_not_disposed,
  488.  
  489.         glyph_tangents_have_no_effect,
  490.         glyph_positions_determined_by_advance,
  491.         transform_viewPorts_already_set,
  492.  
  493.         directShape_attribute_set_as_side_effect,
  494.         lockShape_called_as_side_effect,
  495.  
  496.         disposed_dead_caches,
  497.         disposed_live_caches,
  498.         low_on_memory,
  499.         very_low_on_memory,
  500.  
  501.         transform_references_disposed_viewPort
  502.  
  503.     #ifndef privateGraphicTypesIncludes
  504.         ,
  505.         /* library */
  506.         zero_length_string_passed
  507.     #endif
  508.     } gxGraphicNotices;
  509. #endif
  510.  
  511.     typedef long gxGraphicsError;
  512.     typedef long gxGraphicsWarning;
  513.     typedef long gxGraphicsNotice;
  514.  
  515.     typedef void (*gxUserErrorFunction)(gxGraphicsError, long);
  516.     typedef void (*gxUserWarningFunction)(gxGraphicsWarning, long);
  517.     typedef void (*gxUserNoticeFunction)(gxGraphicsNotice, long);
  518. #endif
  519.